package de.koller.worlders.engine.entity.mo.grav;

import de.koller.oceanFramework.math.Vec;
import de.koller.worlders.engine.entity.mo.MovingObject;

public class Gravitron {
	
	private final Vec pos = new Vec();
	
	public Gravitron( float x, float y ) {
		pos.set( x, y );
	}
	
	public Vec getForce( MovingObject mo ) {
		Vec d = mo.getCentre().newInstance().subtract( pos );
		d.setLength( MovingObject.GRAVITY );
		return d.getInverse();
	}
	
}
